import type {
	DropdownOption,
	DropdownGroupOption,
	DropdownDividerOption,
	DropdownIgnoredOption,
} from "naive-ui";

import {
	create,
	NGlobalStyle,
	NConfigProvider,
	NMessageProvider,
	NLoadingBarProvider,
	NNotificationProvider,
	NLayout,
	NLayoutHeader,
	NLayoutSider,
	NLayoutContent,
	NLayoutFooter,
	NTooltip,
	NPopover,
	NButton,
	NInput,
	NElement as NEl,
	NForm,
	NFormItem,
	NFormItemGi,
	NIcon,
	darkTheme,
	NTabs,
	NTabPane,
	NGrid,
	NGi,
	NSpace,
	NCheckbox,
	NScrollbar,
	NMenu,
	NDivider,
	NSelect,
	NSwitch,
	NBackTop,
	NUpload,
	NDialog,
	NDropdown,
	NBreadcrumb,
	NBreadcrumbItem,
	NCheckboxGroup,
	NAvatar,
	NText,
	NBadge,
	NDialogProvider,
	NUploadDragger,
	NModal,
	NEmpty,
} from "naive-ui";

const components = [
	NGlobalStyle,
	NConfigProvider,
	NMessageProvider,
	NLoadingBarProvider,
	NNotificationProvider,
	NDialogProvider,
	NLayout,
	NLayoutHeader,
	NLayoutSider,
	NLayoutContent,
	NLayoutFooter,
	NTooltip,
	NPopover,
	NButton,
	NInput,
	NEl,
	NForm,
	NFormItem,
	NFormItemGi,
	NIcon,
	darkTheme,
	NTabs,
	NTabPane,
	NGrid,
	NGi,
	NSpace,
	NCheckbox,
	NCheckboxGroup,
	NScrollbar,
	NMenu,
	NDivider,
	NSelect,
	NSwitch,
	NBackTop,
	NUpload,
	NUploadDragger,
	NDialog,
	NDropdown,
	NBreadcrumb,
	NBreadcrumbItem,
	NAvatar,
	NText,
	NBadge,
	NModal,
	NEmpty,
	NIcon,
];

const navie = create({
	components,
});

// 导出 组件、function
export {
	useThemeVars,
	darkTheme,
	useMessage,
	useLoadingBar,
	useNotification,
	useDialog,
	NIcon,
	NElement as NEl,
	NThemeEditor,
} from "naive-ui";

export { default as NConfig } from "./components/NConfig.vue";

// 导出 types
export type {
	MessageOptions,
	MessageProviderInst,
	GlobalThemeOverrides,
	LoadingBarProviderInst,
	NotificationProviderInst,
	DialogProviderInst,
} from "naive-ui";

export type DarkTheme = typeof darkTheme;

// dropdown options type
export type DropOptions =
	| DropdownOption
	| DropdownGroupOption
	| DropdownDividerOption
	| DropdownIgnoredOption;

export default navie;
